import request from '@/utils/request';

export async function getBatchPlanByPage(params: any) {
  return request('/api/project/getBatchPlanByPage', {
    method: 'POST',
    data: params,
  });
}

export async function updateBatchPlanProduct(params: any) {
  return request('/api/project/updateBatchPlanProduct', {
    method: 'POST',
    data: params,
  });
}

//生成修改批次计划的表单项
export async function genUpdateBatchPlanForm(params: any) {
  return request('/api/project/genUpdateBatchPlanForm', {
    method: 'POST',
    params: {
      batchPlanId: params,
    },
  });
}

//生成添加批次计划的表单项
export async function genAddBatchPlanForm(params: any) {
  return request('/api/project/genAddBatchPlanForm', {
    method: 'POST',
    params: {
      infoId: params,
    },
  });
}

//修改时间的接口
export async function updateBatchPlanTime(params: any) {
  return request('/api/project/updateBatchPlanTime', {
    method: 'POST',
    data: params,
  });
}

export async function addBatchPlan(params: any) {
  return request('/api/project/addBatchPlan', {
    method: 'POST',
    data: params,
  });
}

export async function updateBatchPlan(params: any) {
  return request('/api/project/updateBatchPlan', {
    method: 'POST',
    data: params,
  });
}

export async function delBatchPlan(params: any) {
  return request('/api/project/delBatchPlan', {
    method: 'POST',
    data: params,
  });
}

//批量发布柜体
export async function releaseBatchPlan(params: any) {
  return request('/api/project/releaseBatchPlan', {
    method: 'POST',
    data: params,
  });
}

export async function exportBatchPlan(params: any) {
  return request('/api/project/exportBatchPlan', {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

//查询接口/api/project/getBatchPlanAndStageByPageAndInfoId
export async function getBatchPlanAndStageByPageAndInfoId(params: any) {
  return request('/api/project/getBatchPlanAndStageByPageAndInfoId', {
    method: 'POST',
    data: params,
  });
}

///api/project/getBatchPlanAndStageByPage
export async function getBatchPlanAndStageByPage(params: any) {
  return request('/api/project/getBatchPlanAndStageByPage', {
    method: 'POST',
    data: params,
  });
}

export async function updateBatchPlanStageTime(params: any) {
  return request('/api/project/updateBatchPlanStageTime', {
    method: 'POST',
    data: params,
  });
}

//api/project/countUnAssginProduct
export async function countUnAssginProduct(params: any) {
  return request('/api/project/countUnAssginProduct', {
    method: 'POST',
    params: {
      infoId: params,
    },
  });
}

export default { getBatchPlanByPage, addBatchPlan, updateBatchPlan, delBatchPlan, exportBatchPlan };
